import java.io.*;

import static 图形界面.JDBC1.save4;

public class FIleInDatabase {
    //将文件a中信息存入maccount中
    public static void readInforMA(String fileName) throws IOException {
        String filename = "D:\\filedemo\\maccount1.txt"; // 请将 your_file_path 替换为实际的文件路径
        try (BufferedReader reader = new BufferedReader(new FileReader(filename))) {
            String line;
            while ((line = reader.readLine())!= null) {
                String[] elements = line.split(" ");
                for (int i = 0; i < elements.length; i += 3) {
                    if (i + 2 < elements.length) {
                        String str1 = elements[i];
                        String str2 = elements[i + 1];
                        String str3 = elements[i + 2];
                        JDBC1.save4(str1,str2,str3);
                    }
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
